package com.example.administrator.share;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;

import cn.sharesdk.framework.Platform;
import cn.sharesdk.framework.ShareSDK;
import cn.sharesdk.onekeyshare.OnekeyShare;
import cn.sharesdk.sina.weibo.SinaWeibo;

/**
 * key: b6de1a5bc8a5    secret: fad0047a91e12529a6cee50dab309ec1
 */
public class MainActivity extends AppCompatActivity {



    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        ShareSDK.initSDK(getApplicationContext());
        Button btn= (Button) findViewById(R.id.btn);
        btn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
               showShare();
                //shareSina();
            }
        });

    }

    private void showShare() {
        OnekeyShare oks=new OnekeyShare();
        oks.disableSSOWhenAuthorize();
        oks.setTitle("一键分享");
        oks.setText("------");
        oks.setComment("......");
        oks.show(this);
    }
    private void shareSina(){
        Platform sina=ShareSDK.getPlatform(SinaWeibo.NAME);
        SinaWeibo.ShareParams params=new SinaWeibo.ShareParams();
        params.setTitle("=========");
        params.setText("电影女神图集");
        params.setComment(".........");
        sina.share(params);
    }

}
